package com.yzr.common.thread.counter;

import java.util.concurrent.CountDownLatch;

public class CountDownLathTest {
    public static void main(String[] args) throws InterruptedException {
        CountDownLatch countDownLatch = new CountDownLatch(7);
        for (int i = 1; i <= 10; i++) {
            new Thread(() -> {
            }, String.valueOf(i)).start();
            countDownLatch.countDown();
            System.out.println("第" + i + "学生");
        }
        countDownLatch.await();
        System.out.println("close door");
    }
}
